package ar.Location.Map;

import android.util.Log;
import ar.Location.Constant.Define;
import ar.Location.Helper.BitmapProvider;
import ar.Location.PlaceObject.Place;

import com.google.android.maps.GeoPoint;
import com.google.android.maps.OverlayItem;

public class MyOverlayItem extends OverlayItem {

	private static final String TAG = "MyOverlayItem";
	public Place place = null;

	public MyOverlayItem(GeoPoint point, String title, String snippet) {
		super(point, title, snippet);
		// TODO Auto-generated constructor stub
	}

	public void updateInfoFrom(Place fPlace) {
		place = fPlace;

		if (place != null) {
			Log.d(TAG, place.categoryName);

			if (place.categoryName.equals(Define.DF_CAFE)) {
				setMarker(BitmapProvider.drawableMarkerCafe);
			} else if (place.categoryName.equals(Define.DF_FOOD)) {
				setMarker(BitmapProvider.drawableMarkerFood);
			} else if (place.categoryName.equals(Define.DF_PARK)) {
				setMarker(BitmapProvider.drawableMarkerPark);
			} else if (place.categoryName.equals(Define.DF_BANK)) {
				setMarker(BitmapProvider.drawableMarkerBank);
			} else if (place.categoryName.equals(Define.DF_UNIVERSITY)) {
				setMarker(BitmapProvider.drawableMarkerUniversity);
			} else if (place.categoryName.equals(Define.DF_HOSPITAL)) {
				setMarker(BitmapProvider.drawableMarkerHospital);
			} else if (place.categoryName.equals(Define.DS_WIKIPEDIA)) {
				setMarker(BitmapProvider.drawableMarkerWikipedia);
			} else if (place.categoryName.equals(Define.DS_FLICKR)) {
				setMarker(BitmapProvider.drawableMarkerFlickr);
			} else if (place.categoryName.equals(Define.DS_EVENTFUL)) {
				setMarker(BitmapProvider.drawableMarkerEventful);
			} else if (place.categoryName.equals(Define.DS_GOOGLE_PLACE)) {
				setMarker(BitmapProvider.drawableMarkerGooglePlace);
			} else if (place.categoryName.equals(Define.DS_FOURSQUARE)) {
				setMarker(BitmapProvider.drawableMarkerFoursquare);
			}
		}
	}
}
